//
//  SearchDetialViewController.m
//  HomeIn
//
//  Created by dllo on 15/11/10.
//  Copyright © 2015年 ZZP. All rights reserved.
//

#import "SearchDetialViewController.h"
#import "SearchModel.h"
@interface SearchDetialViewController ()

@property(nonatomic,strong)UIWebView *myWebView;

@end

@implementation SearchDetialViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor wheatColor];
    self.navigationItem.title = @"商品详情";
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"iconfont-unie642.png"] style:UIBarButtonItemStyleDone target:self action:@selector(leftBarButtonItemAction:)];
    
    self.myWebView = [[UIWebView alloc]initWithFrame:CGRectMake(0, -60 * HEIGHTSCALE, 375*WIDTHSCALE, (667+60)*HEIGHTSCALE)];
    NSString *str = [NSString stringWithFormat:@"http://bohejiaju.liwushuo.com/items/%ld",self.model.id];
    NSURL *url = [NSURL URLWithString:str];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [self.myWebView loadRequest:request];
    [self.view addSubview:self.myWebView];
    self.myWebView.scrollView.userInteractionEnabled = YES;
    
    for(id subview in self.myWebView.subviews)
    {
        
        if([[subview class]isSubclassOfClass:[UIScrollView class]])
            ((UIScrollView*)subview).bounces = NO;
        
        self.myWebView.scrollView.bounces = NO;
        
    }
}


-(void)leftBarButtonItemAction:(UIBarButtonItem *)barButtonItem
{
    [self.navigationController popViewControllerAnimated:YES];
}

    


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
